﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Utility.Helper
{
    public class FileDirectoryExtension
    {
        /// <summary>
        /// 当前域路径
        /// </summary>
        /// <returns></returns>
        public static string CurrentDomainDirectory()
            => AppDomain.CurrentDomain.BaseDirectory;

        /// <summary>
        /// 环境路径
        /// </summary>
        /// <returns></returns>
        public static string EnvironmentDirectory()
           => System.Environment.CurrentDirectory;

        /// <summary>
        /// 程序集路径
        /// </summary>
        /// <returns></returns>
        public static string AssemblyDirectory()//建议使用
           => Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

        /// <summary>
        /// 临时文件
        /// </summary>
        /// <returns></returns>
        public static string TemporaryDirectory()
            => Path.GetTempPath();


    }
}
